package com.kefu.call.vo;

import javax.persistence.Id;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

import com.kefu.call.model.ActivityBaseInfo;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author francis
 * @date 2021/05/22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "活动管理")
public class ActivityBaseInfoUpdateVo extends AbstractUpdateVo<ActivityBaseInfo,String> {

    
	@NotEmpty
    @ApiModelProperty(value = "主键")
    private String activityId;

    @ApiModelProperty(value = "数据状态0 无效，1有效",hidden=true)
    private Integer dataStatus=1;

    @ApiModelProperty(value = "活动名称")
    private String activityName;

    @ApiModelProperty(value = "活动描述")
    private String activityDesp;

    @ApiModelProperty(value = "活动类型",example="1",allowableValues="1",notes="1 外呼活动")
    private Integer activityType;

    @ApiModelProperty(value = "活动状态",example="1",allowableValues="0,1,2,3",notes="0 未启用，1启用，2暂停，3 停止")
    private Integer activityStatus;

    @ApiModelProperty(value = "活动开始时间")
    private Long activityStartTime;

    @ApiModelProperty(value = "活动结束时间")
    private Long activityEndTime;

    @ApiModelProperty(value = "是否隐藏号码")
    private Integer hiddenNum;

    @ApiModelProperty(value = "是否开启问卷", allowableValues = "0,1", notes = "0 不开启，1 开启")
    private Integer paperOpen;

    @ApiModelProperty(value = "试卷ID")
    private String paperId;
    
    @ApiModelProperty(value = "坐席助手ID")
    private String helperId;
    @Override
    public ActivityBaseInfo convert() {
        ActivityBaseInfo info = new ActivityBaseInfo();
        info.setDataStatus(dataStatus);
        info.setActivityName(activityName);
        info.setActivityDesp(activityDesp);
        info.setActivityType(activityType);
        info.setActivityStatus(activityStatus);
        info.setActivityStartTime(activityStartTime);
        info.setActivityEndTime(activityEndTime);
        info.setHiddenNum(hiddenNum);
        KefuContext context = KefuContext.getKefuContext();
        info.setActivityId(activityId);
        info.setPaperOpen(paperOpen);
        info.setPaperId(paperId);
        info.setHelperId(helperId);
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        return info;
	}
}